var myPlaceHolder = "_"
function gradMask() {
	(function($) {
		$("input[name^='cur_gra[data_inicio]']").unmask().unbind("keyup").mask("99/9999", {placeholder:myPlaceHolder}).autotab({maxlength: 7, relativeTarget: '$(this).parents("tr.gra").find("input[name^=\'cur_gra[data_termino]\']")', ignore: myPlaceHolder });
		$("input[name^='cur_gra[data_termino]']").unmask().unbind("keyup").mask("99/9999", {placeholder:myPlaceHolder}).autotab({maxlength: 7, relativeTarget: '$(this).parents("tr.gra").find("select[name^=\'cur_gra[ano_atual]\']")', ignore: myPlaceHolder });
	})(jQuery);
}
function expMask() {
	(function($) {
		$("input[name^='cur_exp[centavos]']").autotab({format: "numeric", maxlength: 2, relativeTarget: '$(this).parents("tr.exp").find("textarea[name^=\'cur_exp[descricao]\']")', ignore: myPlaceHolder });
		$("input[name^='cur_exp[salario]']").maskMoney({ symbol: "", decimal: ",", thousands: ".", precision: 0 });
		$("input[name^='cur_exp[data_entrada]']").unmask().unbind("keyup").mask("99/9999", {placeholder:myPlaceHolder}).autotab({maxlength: 7, relativeTarget: '$(this).parents("tr.exp").find("input[name^=\'cur_exp[data_saida]\']")', ignore: myPlaceHolder });
		$("input[name^='cur_exp[data_saida]']").unmask().unbind("keyup").mask("99/9999", {placeholder:myPlaceHolder}).autotab({maxlength: 7, relativeTarget: '$(this).parents("tr.exp").find("input[name^=\'cur_exp[empresa]\']")', ignore: myPlaceHolder });
	})(jQuery);
}

(function($) {

	
	$(document).ready(function(){

		$("#formularioIncCv input:radio, #formularioIncCv input:checkbox").keyup(function(e){
			if(e.keyCode == 13) $(this).attr("checked", !$(this).attr("checked"));
		});

		$("#backcpf").mask("999.999.999-99", {placeholder:myPlaceHolder}).autotab({maxlength: 14, target: "data_nasc", ignore: myPlaceHolder });
		$("#forgotEmailCpf").mask("999.999.999-99", {placeholder:myPlaceHolder});
		$("#data_nasc").mask("99/99/9999", {placeholder:myPlaceHolder}).autotab({maxlength: 10, target: "dataHide", ignore: myPlaceHolder });
		$("#cep").mask("99999-999", {placeholder:myPlaceHolder}).autotab({maxlength: 9, target: "formularioIncCv", ignore: myPlaceHolder });
		$("#phone, #phoneCom, #celphone").mask("99-9999-9999", {placeholder:myPlaceHolder});
		$("#phone").attr("maxlength", 12).autotab({target: "phoneCom", ignore: myPlaceHolder });
		$("#phoneCom").attr("maxlength", 12).autotab({target: "homepage", ignore: myPlaceHolder });
		$("#celphone").attr("maxlength", 12).autotab({target: "phone", ignore: myPlaceHolder });
		$("#endNumero").numeric();
		
		gradMask();
		expMask();

	});




})(jQuery);